﻿<?php header('Content-Type: text/xml'); ?>
<?php echo '<?xml version="1.0" encoding="UTF-8"?>'; ?>

<?php
		
	echo '<result>';
        

    $dbc = mysqli_connect( 'localhost' ,'root' , '1234', 'teresa' ) or die( 'Error connecting to MySQL server.');
			
    $user_email = $_GET['user_email'];
    $user_password = $_GET['user_password'];

    if( !empty( $user_email ) && !empty( $user_password ) ){
        $query = "SELECT email, first_name, user_id FROM teresa_user WHERE email = '$user_email' and password = SHA( '$user_password')";
        $data = mysqli_query( $dbc , $query);
        if( mysqli_num_rows( $data ) == 1 ){
		
          echo '<A>true</A>';
        }else{
			    echo '<A>false</A>';
        }
    }else{
			echo '<A>false</A>';
    }

	echo '</result>';
?>

